package com.xuecheng.learning.feign;

import com.xuecheng.commons.model.dto.RecordDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.learning.service.CourseRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 选课记录前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class FeignCourseRecordController {

    @Autowired
    private CourseRecordService  courseRecordService;
    /**
     * 保存/更新选课记录
     * @param recordDto {coursePubId，userId}
     * @return {code , message}
     */
    @PostMapping("/courseRecord/saveRecord")
    public ResponseResult saveRecord(@RequestBody RecordDto recordDto){
        return courseRecordService.saveRecord(recordDto);
    }
}
